<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" >
    <script>
        // Example starter JavaScript for disabling form submissions if there are invalid fields
        (function() {
          'use strict';
          window.addEventListener('load', function() {
            // Fetch all the forms we want to apply custom Bootstrap validation styles to
            var forms = document.getElementsByClassName('needs-validation');
            // Loop over them and prevent submission
            var validation = Array.prototype.filter.call(forms, function(form) {
              form.addEventListener('submit', function(event) {
                if (form.checkValidity() === false) {
                  event.preventDefault();
                  event.stopPropagation();
                }
                form.classList.add('was-validated');
              }, false);
            });
          }, false);
        })();
        </script>
</head>
<body>
    <div class="container">
        <h1>***表单</h1>
        <form class="needs-validation" novalidate>
            <div class="form-group">
                <label for="name">姓名</label>
                <input type="text" name="name" placeholder="请输入姓名" required class="form-control"/>
                <small class="form-text text-muted">中国人的姓名，一般2到4个汉字</small>
            </div>
            <div class="form-group">
                <label for="loginId">账号</label>
                <input type="text" name="loginId" placeholder="请输入账号" required class="form-control"/>
                <small  class="form-text text-muted">账号一般5到10位</small>
            </div>
            <div class="form-group">
                <label for="phNum">手机号</label>
                <input type="text" name="phNum" placeholder="请输入手机号" required pattern="/d(11)" class="form-control"/>
                <small  class="form-text text-muted">11位数字</small>
                <div class="invalid-feedback">
                    手机号必须1开头，11位
                </div>
                <div class="valid-feedback">
                    手机号必须1开头，11位
                </div>
            </div>
            <div class="form-group">
                <label for="address">地址</label>
                <input type="text" name="address" placeholder="请输入地址" class="form-control"/>
            </div>
            <div class="form-group">
                <label for="birthday">出生年月</label>
                <input type="date" name="birthday" placeholder="请输入出生年月日" required class="form-control"/>
            </div>
            <button type="submit" class="btn btn-primary">提交</button>
   
        </form>
    </div>

    <script src="https://lib.baomitu.com/jquery/3.5.0/jquery.js" ></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" ></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" ></script>
</body>
</html>